home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Isometric Game Programming with DirectX 7.0
/
Isometric Game Programming.iso
/
source
/
chapter21
/
isohex21_1
/
isorenderer.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-08-17
|
2KB
|
71 lines
//IsoRendere.h
#ifndef __ISORENDERER_H__
#define __ISORENDERER_H__
#include "IsoHexCore.h"
#include <ddraw.h>
//rendering function pointer typedef
typedef void (*RENDERFN)(LPDIRECTDRAWSURFACE7 lpddsDst,RECT* rcClip,int xDst,int yDst,int xMap,int yMap);
//CRenderer Declaration
class CRenderer
{
public:
///////////////////
//members
///////////////////
//surfaces
LPDIRECTDRAWSURFACE7 lpddsBackBuffer;//back buffer
LPDIRECTDRAWSURFACE7 lpddsFrameBuffer;//frame buffer
//isohexcore components
CTilePlotter* pTilePlotter;//plotter
CTileWalker* pTileWalker;//walker
CMouseMap* pMouseMap;//mousemap
CScroller* pScroller;//scroller
//update RECT list
RECT* rcUpdateList;//must be allocated
int iUpdateRectCount;//number of RECTs in the update list
int iUpdateRectIndex;//stores the next update RECT in the list
//update map
bool* bMap;//will be allocated with enough space for the entire map
int iMapWidth;//width of the map
int iMapHeight;//height of the map
//extent rect
RECT rcExtent;//extent rect, used when adding tiles to the update list
//rendering function
RENDERFN RenderFunction;//function used to render a tile
/////////////////////
//member functions
/////////////////////
//constructor
CRenderer();
virtual ~CRenderer();
//destructor
//surfaces
void SetBackBuffer(LPDIRECTDRAWSURFACE7 lpdds);
void SetFrameBuffer(LPDIRECTDRAWSURFACE7 lpdds);
//isohexcore components
void SetPlotter(CTilePlotter* pPlotter);
void SetWalker(CTileWalker* pWalker);
void SetMouseMap(CMouseMap* pMMap);
void SetScroller(CScroller* pScroll);
//update list
void SetUpdateRectCount(int iMaxRects);//sets up the rectangle list
//update map
void SetMapSize(int MapWidth,int MapHeight);//sets up the update map
//rendering functions
void SetRenderFunction(RENDERFN RendFunc);
//extent rect
void SetExtentRect(RECT* rcExt);
//add rect to list
void AddRect(RECT* prcAdd);
void AddTile(int mapx,int mapy);
//scroll the frame
void ScrollFrame(int scrollx,int scrolly);
//update the frame
void UpdateFrame();
};
#endif